package com.javacoo.junit.generator.config;

import java.util.Properties;

/**
 * PropertyHolder
 * <li></li>
 *
 * @author: duanyong@jccfc.com
 * @since: 2020/12/31 13:47
 */
public abstract class PropertyHolder {
    /**
     * properties对象
     */
    private final Properties properties;

    protected PropertyHolder() {
        super();
        properties = new Properties();
    }
    /**
     * 添加配置
     * <li></li>
     * @author duanyong@jccfc.com
     * @date 2020/12/31 13:49
     * @param name: 名称
     * @param value: 值
     */
    public void addProperty(String name, String value) {
        properties.setProperty(name, value);
    }
    /**
     * 根据指定配置名称获取其值
     * <li></li>
     * @author duanyong@jccfc.com
     * @date 2020/12/31 13:49
     * @param name: 配置名称
     * @return: java.lang.String 对应值
     */
    public String getProperty(String name) {
        return properties.getProperty(name);
    }
    /**
     * 获取当前properties对象
     * <li></li>
     * @author duanyong@jccfc.com
     * @date 2020/12/31 13:50
     * @return: java.util.Properties
     */
    public Properties getProperties() {
        return properties;
    }
}
